<?php
class class_Charts
{
	private $_db; 
	function __construct()
	{
		$this->config();
	}
	private function config()
	{
		require_once("conexion.php");
		require_once("DataBase.php");
		$this->_db = new DataBase($SERVIDOR,$USUARIO,$PASSWORD,$BASE);
		mysql_query("SET NAMES utf8");
	}
	function method_getObrasSociales($params, $error)
    {
        if (count($params) != 0) { $error->SetError(JsonRpcError_ParameterMismatch, "Expected 0 parameter; got " . count($params)); return $error; }
        
        $this->_db->setQuery("SELECT CONCAT('( ', cod_obra_social, ' )', ' - ', descripcion) as os FROM obras_sociales");
        $this->_db->alter();
    	if (mysql_error()) { $error->SetError(JsonRpcError_Unknown, (__FILE__ . " - " . (__LINE__ - 2) . ": " . mysql_error())); return $error; }
		return $this->_db->loadResult();
    }

}
?>